home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 September / Chip_2000-09_cd1.bin / sharewar / Slunec / app / 16 / ANIM.SWG / 0013_AutoDesk Animator Pro FormatS.pas < prev    next >
Pascal/Delphi Source File  |  1997-05-11  |  39KB  |  1,089 lines

  1. Animator Pro File Formats
  2.  
  3.  
  4. This chapter details each of the file formats defined
  5. by Animator Pro.  Formats supported by Animator Pro but
  6. defined by another party, such as GIF and TIFF files,
  7. are not described in this document.
  8.  
  9. The files created by Autodesk Animator Pro are a
  10. superset of those created by the original Autodesk
  11. Animator.  In some cases the Animator Pro formats are
  12. identical with the older Animator format.  In other
  13. cases, new data fields or data compression techniques
  14. have been added to the file.  
  15.  
  16. All two-byte and four-byte data values in Animator Pro
  17. files are stored in Intel-style order, the same as they
  18. would appear in memory on an 80x86 machine.
  19.  
  20.  
  21. Common Hierarchial Chunked File Structure
  22.  
  23.  
  24. In general, Animator Pro files contain one or more
  25. chunks of information.  Conceptually, a chunk is a
  26. combination of control information and data.  The most
  27. common Animator Pro file format is a header structure
  28. followed by hierarchial data chunks.
  29.  
  30. Every chunk begins with a header of at least 6 bytes.
  31. The first four bytes contain the length of the chunk
  32. (including the header itself, and also including the
  33. length of all subordinate chunks, if any).  The next two
  34. bytes are an identifier word which describes the type
  35. of data in the chunk.  Some chunks have headers longer
  36. than six bytes, but the size and identifier fields
  37. always occupy the first six bytes of the header.
  38.  
  39. The Animator Pro animation file is a good example of a
  40. hierarchial chunked file structure.  The data in an 
  41. animation file is arranged as follows:
  42.  
  43.       animation file:
  44.             optional prefix chunk: 
  45.                   settings chunk
  46.                   cel placement chunk
  47.             frame 1 chunk:
  48.                   postage stamp chunk:
  49.                         postage stamp data
  50.                   color palette chunk
  51.                   pixel data chunk
  52.             frame 2 chunk:
  53.                   pixel data chunk
  54.             frame 3 chunk:
  55.                   color palette chunk
  56.                   pixel data chunk
  57.             frame 4 chunk:  
  58.                   color palette chunk
  59.             ring frame chunk:
  60.                   color palette chunk
  61.                   pixel data chunk
  62.  
  63. It is possible that new types of chunks not described
  64. in this document will be added to animation files in the
  65. future.  We recommend that you quietly ignore unknown
  66. chunk types you encounter during animation playback. 
  67. The size fields in the chunk headers make it easy to
  68. skip an entire unrecognized chunk.
  69.  
  70.  
  71. FLC - Animator Pro Flic Files
  72.  
  73.  
  74. This is the main animation file format created by
  75. Animator Pro.  The file contains a 128-byte header,
  76. followed by an optional prefix chunk, followed by one
  77. or more frame chunks.  
  78.  
  79. The prefix chunk, if present, contains Animator Pro
  80. settings information, CEL placement information, and
  81. other auxiliary data.
  82.  
  83. A frame chunk exists for each frame in the animation. 
  84. In addition, a ring frame follows all the animation
  85. frames.  Each frame chunk contains color palette
  86. information and/or pixel data.
  87.  
  88. The ring frame contains delta-compressed information to
  89. loop from the last frame of the flic back to the first. 
  90. It can be helpful to think of the ring frame as a copy
  91. of the first frame, compressed in a different way.  All
  92. flic files will contain a ring frame, including a
  93. single-frame flic.
  94.  
  95.  
  96. The FLC file header
  97.  
  98.  
  99. A FLC file begins with a 128-byte header, described
  100. below.  All lengths and offsets are in bytes.  All 
  101. values stored in the header fields are unsigned.
  102.  
  103. Offset  Length  Name      Description
  104.  
  105.    0      4     size      The size of the entire
  106.                           animation file, including this
  107.                           file header.
  108.  
  109.    4      2     magic     File format identifier.
  110.                           Always hex AF12.
  111.  
  112.    6      2     frames    Number of frames in the flic. 
  113.                           This count does not include
  114.                           the ring frame.  FLC files
  115.                           have a maximum length of 4000
  116.                           frames.
  117.  
  118.    8      2     width     Screen width in pixels.
  119.  
  120.   10      2     height    Screen height in pixels.
  121.  
  122.   12      2     depth     Bits per pixel (always 8).
  123.  
  124.   14      2     flags     Set to hex 0003 after ring
  125.                           frame is written and flic
  126.                           header is updated.  This
  127.                           indicates that the file was
  128.                           properly finished and closed.
  129.  
  130.   16      4     speed     Number of milliseconds to
  131.                           delay between each frame
  132.                           during playback.
  133.  
  134.   20      2     reserved  Unused word, set to 0.
  135.  
  136.   22      4     created   The MSDOS-formatted date and
  137.                           time of the file's creation.
  138.  
  139.   26      4     creator   The serial number of the
  140.                           Animator Pro program used to
  141.                           create the file.  If the file
  142.                           was created by some other
  143.                           program using the FlicLib
  144.                           development kit, this value
  145.                           is hex 464C4942 ("FLIB").
  146.  
  147.   30      4     updated   The MSDOS-formatted date and
  148.                           time of the file's most recent
  149.                           update.
  150.  
  151.   34      4     updater   Indicates who last updated
  152.                           the file.  See the description
  153.                           of creator.
  154.  
  155.   38      2     aspectx   The x-axis aspect ratio at
  156.                           which the file was created.
  157.  
  158.   40      2     aspecty   The y-axis aspect ratio at
  159.                           which the file was created. 
  160.                           Most often, the x:y aspect
  161.                           ratio will be 1:1.  A 320x200
  162.                           flic has a ratio of 6:5.
  163.  
  164.   42     38     reserved  Unused space, set to zeroes.
  165.  
  166.   80      4     oframe1   Offset from the beginning of
  167.                           the file to the first
  168.                           animation frame chunk.
  169.  
  170.   84      4     oframe2   Offset from the beginning of
  171.                           the file to the second
  172.                           animation frame chunk.  This
  173.                           value is used when looping
  174.                           from the ring frame back to
  175.                           the second frame during
  176.                           playback.
  177.  
  178.   88     40     reserved  Unused space, set to zeroes.
  179.  
  180. The FLC prefix chunk
  181.  
  182.  
  183. An optional prefix chunk may immediately follow the
  184. animation file header.  This chunk is used to store
  185. auxiliary data which is not directly involved in the
  186. animation playback.  The prefix chunk starts with a
  187. 16-byte header (identical in structure to a frame
  188. header), as follows:
  189.  
  190. Offset  Length  Name      Description
  191.  
  192.    0      4     size      The size of the prefix chunk,
  193.                           including this header and all
  194.                           subordinate chunks that
  195.                           follow.
  196.  
  197.    4      2     type      Prefix chunk identifier. 
  198.                           Always hex F100.
  199.  
  200.    6      2     chunks    Number of subordinate chunks
  201.                           in the prefix chunk.
  202.  
  203.    8      8     reserved  Unused space, set to zeroes.
  204.  
  205. To determine whether a prefix chunk is present, read the
  206. 16-byte header following the file header.  If the type
  207. value is hex F100, it's a prefix chunk.  If the value
  208. is hex F1FA it's the first frame chunk, and no prefix
  209. chunk exists.
  210.  
  211. Note
  212.       Programs other than Animator Pro should
  213.       never need to create flic files that 
  214.       contain a prefix chunk.  Programs reading
  215.       a flic file should skip the prefix chunk by
  216.       using the size value in the prefix header
  217.       to read and discard the prefix, or by
  218.       seeking directly to the first frame using
  219.       the oframe1 field from the file header.
  220.  
  221.  
  222. The FLC frame chunks
  223.  
  224.  
  225. Frame chunks contain the pixel and color data for the
  226. animation.  A frame chunk may contain multiple
  227. subordinate chunks, each containing a different type of
  228. data for the current frame.  Each frame chunk starts
  229. with a 16-byte header that describes the contents of
  230. the frame:
  231.  
  232. Offset  Length  Name      Description
  233.  
  234.    0      4     size      The size of the frame chunk,
  235.                           including this header and all
  236.                           subordinate chunks that
  237.                           follow.
  238.  
  239.    4      2     type      Frame chunk identifier. 
  240.                           Always hex F1FA.
  241.  
  242.    6      2     chunks    Number of subordinate chunks
  243.                           in the frame chunk.
  244.  
  245.    8      8     reserved  Unused space, set to zeroes.
  246.  
  247. Immediately following the frame header are the frame's
  248. subordinate data chunks.  When the chunks count in the
  249. frame header is zero, it indicates that this frame is
  250. identical to the previous frame.  This implies that no
  251. change is made to the screen or color palette, but the
  252. appropriate delay is still inserted during playback.
  253.  
  254. Each data chunk within a frame chunk is formatted as
  255. follows:
  256.  
  257. Offset  Length  Name      Description
  258.  
  259.    0       4    size      The size of the chunk,
  260.                           including this header.
  261.  
  262.    4       2    type      Data type identifier.
  263.  
  264.    6   (size-6) data      The color or pixel data.
  265.  
  266.  
  267. The type values in the chunk headers indicate what type
  268. of graphics data the chunk contains and which
  269. compression method was used to encode the data.  The
  270. following values (and their associated mnemonic names)
  271. are currently found in frame data chunks:
  272.  
  273. Value  Name             Description
  274.  
  275.   4    FLI_COLOR256     256-level color palette info
  276.   7    FLI_SS2          Word-oriented delta compression
  277.  11    FLI_COLOR        64-level color palette info
  278.  12    FLI_LC           Byte-oriented delta compression
  279.  13    FLI_BLACK        Entire frame is color index 0
  280.  15    FLI_BRUN         Byte run length compression
  281.  16    FLI_COPY         No compression
  282.  18    FLI_PSTAMP       Postage stamp sized image
  283.  
  284. The following sections describe each of these data
  285. encoding methods in detail.
  286.  
  287.  
  288. Chunk Type  4 (FLI_COLOR256) - 256-Level Color
  289.  
  290.  
  291. The data in this chunk is organized in packets.  The
  292. first word following the chunk header is a count of the
  293. number of packets in the chunk.  Each packet consists
  294. of a one-byte color index skip count, a one-byte color
  295. count and three bytes of color information for each
  296. color defined.
  297.  
  298. At the start of the chunk, the color index is assumed
  299. to be zero.  Before processing any colors in a packet,
  300. the color index skip count is added to the current
  301. color index.  The number of colors defined in the
  302. packet is retrieved.  A zero in this byte indicates 256
  303. colors follow.  The three bytes for each color define
  304. the red, green, and blue components of the color in
  305. that order.  Each component can range from 0 (off) to
  306. 255 (full on).  
  307. The data to change colors 2,7,8, and 9 would appear as
  308. follows:
  309.  
  310.       2                       ; two packets 
  311.       2,1,r,g,b               ; skip 2, change 1 
  312.       4,3,r,g,b,r,g,b,r,g,b   ; skip 4, change 3
  313.  
  314.  
  315. Chunk Type 11 (FLI_COLOR) - 64-Level Color
  316.  
  317.  
  318. This chunk is identical to FLI_COLOR256 except that the
  319. values for the red, green and blue components are in
  320. the range of 0-63 instead of 0-255.
  321.  
  322.  
  323. Chunk Type 13 (FLI_BLACK) - No Data
  324.  
  325.  
  326. This chunk has no data following the header.  All
  327. pixels in the frame are set to color index 0.
  328.  
  329.  
  330. Chunk Type 16 (FLI_COPY) - No Compression
  331.  
  332.  
  333. This chunk contains an uncompressed image of the frame. 
  334. The number of pixels following the chunk header is
  335. exactly the width of the animation times the height of
  336. the animation.  The data starts in the upper left
  337. corner with pixels copied from left to right and then
  338. top to bottom.  This type of chunk is created when the
  339. preferred compression method (SS2 or BRUN) generates
  340. more data than the uncompressed frame image; a
  341. relatively rare situation.
  342.  
  343.  
  344. Chunk Type 15 (FLI_BRUN) - Byte Run Length Compression
  345.  
  346.  
  347. This chunk contains the entire image in a compressed
  348. format.  Usually this chunk is used in the first frame
  349. of an animation, or within a postage stamp image chunk.
  350.  
  351.  
  352. The data is organized in lines.  Each line contains
  353. packets of compressed pixels.  The first line is at the
  354. top of the animation, followed by subsequent lines
  355. moving downward.  The number of lines in this chunk is
  356. given by the height of the animation.
  357.  
  358. The first byte of each line is a count of packets in
  359. the line.  This value is ignored, it is a holdover from
  360. the original Animator.  It is possible to generate more
  361. than 255 packets on a line.  The width of the animation
  362. is now used to drive the decoding of packets on a line;
  363. continue reading and processing packets until width
  364. pixels have been processed, then proceed to the next
  365. line.
  366.  
  367. Each packet consist of a type/size byte, followed by
  368. one or more pixels.  If the packet type is negative it
  369. is a count of pixels to be copied from the packet to
  370. the animation image.  If the packet type is positive it
  371. contains a single pixel which is to be replicated; the
  372. absolute value of the packet type is the number of
  373. times the pixel is to be replicated.
  374.  
  375. Chunk Type 12 (FLI_LC) - Byte Aligned Delta Compression
  376.  
  377.  
  378. This chunk contains the differences between the
  379. previous frame and this frame.  This compression method
  380. was used by the original Animator, but is not created
  381. by Animator Pro.  This type of chunk can appear in an
  382. Animator Pro file, however, if the file was originally
  383. created by Animator, then some (but not all) frames
  384. were modified using Animator Pro.  
  385.  
  386. The first 16-bit word following the chunk header
  387. contains the position of the first line in the chunk. 
  388. This is a count of lines (down from the top of the
  389. image) which are unchanged from the prior frame.  The
  390. second 16-bit word contains the number of lines in the
  391. chunk.  The data for the lines follows these two words.
  392.  
  393. Each line begins with two bytes.  The first byte
  394. contains the starting x position of the data on the
  395. line, and the second byte the number of packets for the
  396. line.  Unlike BRUN compression, the packet count is
  397. significant (because this compression method is only
  398. used on 320x200 flics).
  399.  
  400. Each packet consists of a single byte column skip,
  401. followed by a packet type/size byte.  If the packet
  402. type is positive it is a count of pixels to be copied
  403. from the packet to the animation image.  If the packet
  404. type is negative it contains a single pixel which is to
  405. be replicated; the absolute value of the packet type
  406. gives the number of times the pixel is to be
  407. replicated.
  408.  
  409.                          Note
  410.  
  411.       The negative/positive meaning of the packet
  412.       type bytes in LC compression is reversed
  413.       from that used in BRUN compression.  This
  414.       gives better performance during playback.
  415.  
  416.  
  417. Chunk Type  7 (FLI_SS2) - Word Aligned Delta Compression
  418.  
  419.  
  420. This format contains the differences between
  421. consecutive frames.  This is the format most often used
  422. by Animator Pro for frames other than the first frame
  423. of an animation.  It is similar to the line coded delta
  424. (LC) compression, but is word oriented instead of byte
  425. oriented.  The data is organized into lines and each
  426. line is organized into packets.
  427.  
  428. The first word in the data following the chunk header
  429. contains the number of lines in the chunk.  Each line
  430. can begin with some optional words that are used to
  431. skip lines and set the last byte in the line for
  432. animations with odd widths.  These optional words are
  433. followed by a count of the packets in the line.  The
  434. line count does not include skipped lines.
  435.  
  436. The high order two bits of the word is used to
  437. determine the contents of the word.
  438.  
  439.       Bit 15  Bit 14    Meaning
  440.  
  441.         0       0       The word contains the packet
  442.                         count.  The packets follow this
  443.                         word.  The packet count can be
  444.                         zero; this occurs when only the
  445.                         last pixel on a line changes.
  446.  
  447.         1       0       The low order byte is to be
  448.                         stored in the last byte of the
  449.                         current line.  The packet count
  450.                         always follows this word.
  451.  
  452.         1       1       The word contains a line skip
  453.                         count.  The number of lines
  454.                         skipped is given by the
  455.                         absolute value of the word. 
  456.                         This word can be followed by
  457.                         more skip counts, by a last
  458.                         byte word, or by the packet
  459.                         count.
  460.  
  461. The packets in each line are similar to the packets for
  462. the line coded chunk.  The first byte of each packet is
  463. a column skip count.  The second byte is a packet type. 
  464. If the packet type is positive, the packet type is a
  465. count of words to be copied from the packet to the
  466. animation image.  If the packet type is negative, the
  467. packet contains one more word which is to be
  468. replicated.  The absolute value of the packet type
  469. gives the number of times the word is to be replicated. 
  470. The high and low order byte in the replicated word do
  471. not necessarily have the same value.
  472.  
  473.  
  474. Chunk Type 18 (FLI_PSTAMP) - Postage Stamp Image
  475.  
  476.  
  477. This chunk type holds a postage stamp -- a reduced-
  478. size image -- of the frame.  It generally appears only
  479. in the first frame chunk within a flic file.  
  480.  
  481. When creating a postage stamp, Animator Pro considers
  482. the ideal size to be 100x63 pixels.  The actual size
  483. will vary as needed to maintain the same aspect ratio
  484. as the original.
  485.  
  486. The pixels in a postage stamp image are mapped into a
  487. six-cube color space, regardless of the color palette
  488. settings for the full frame image.  A six-cube color
  489. space is formed as follows:
  490.  
  491.       start at palette entry 0
  492.       for red = 0 thru 5
  493.             for green = 0 thru 5
  494.                   for blue = 0 thru 5
  495.                         palette_red   = (red   * 256)/6
  496.  
  497.                         palette_green = (green * 256)/6
  498.                         palette_blue  = (blue  * 256)/6
  499.                         move to next palette entry
  500.                   end for blue
  501.             end for green
  502.       end for red
  503.  
  504. Any arbitrary rgb value (where each component is in the
  505. range of 0-255) can be mapped into the six-cube space
  506. using the formula:
  507.  
  508.   ((6*red)/256)*36 + ((6*green)/256)*6 + ((6*blue)/256)
  509.  
  510. When a frame data chunk has been identified as a
  511. postage stamp, the header for the chunk contains more
  512. fields than just size and type.  The full postage stamp
  513. chunk header is defined as follows:
  514.  
  515. Offset  Length  Name      Description
  516.  
  517.    0      4     size      The size of the postage stamp
  518.                           chunk, including this header.
  519.  
  520.    4      2     type      Postage stamp identifier;
  521.                           always 18.
  522.  
  523.    6      2     height    Height of the postage stamp
  524.                           image, in pixels.
  525.  
  526.    8      2     width     Width of the postage stamp
  527.                           image, in pixels.
  528.  
  529.   10      2     xlate     Color translation type; 
  530.                           always 1, indicating six-
  531.                           cube color space.
  532.  
  533. Immediately following this header is the postage stamp
  534. data.  The data is formatted as a chunk with standard
  535. size/type header.  The type will be one of:
  536.  
  537. Value  Name             Description
  538.  
  539.  15    FPS_BRUN         Byte run length compression
  540.  16    FPS_COPY         No compression
  541.  18    FPS_XLAT256      Six-cube color xlate table
  542.  
  543. The FPS_BRUN and FPS_COPY types are identical to the
  544. FLI_BRUN and FLI_COPY encoding methods described above.
  545.  
  546. The FPS_XLAT256 type indicates that the chunk contains
  547. a 256-byte color translation table instead of pixel
  548. data.  To process this type of postage stamp, read the
  549. pixel data for the full-sized frame image, and
  550. translate its pixels into six-cube space using a lookup
  551. in the 256-byte color translation table.  This type of
  552. postage stamp appears when the size of the animation
  553. frames is smaller than the standard 100x63 postage
  554. stamp size.
  555.  
  556. FLI - Original Animator Flic Files
  557.  
  558.  
  559. This animation file format is limited to 320x200
  560. resolution.  It is the main animation file format of
  561. the original Animator, and is still used by Animator
  562. Pro for creating 320x200 animations.  The file
  563. structure is very similar to that of a FLC file.  A FLI
  564. file does not contain a prefix chunk, and does not use
  565. FLI_PSTAMP or FLI_SS2 data encoding in the frame
  566. chunks.
  567.  
  568.  
  569. The FLI file header
  570.  
  571.  
  572. The file header for a FLI file is a subset of the FLC
  573. file header.  It is defined as follows:
  574.  
  575. Offset  Length  Name      Description
  576.  
  577.    0      4     size      The size of the entire
  578.                           animation file, including
  579.                           this file header.
  580.  
  581.    4      2     magic     File format identifier. 
  582.                           Always hex AF11.
  583.  
  584.    6      2     frames    Number of frames in the flic. 
  585.                           This count does not include
  586.                           the ring frame.  FLI files
  587.                           have a maximum length of 4000
  588.                           frames.
  589.  
  590.    8      2     width     Screen width in pixels. This
  591.                           is always 320 in a FLI file.
  592.  
  593.   10      2     height    Screen height in pixels. This
  594.                           is always 200 in a FLI file.
  595.  
  596.   12      2     depth     Bits per pixel (always 8).
  597.  
  598.   14      2     flags     Always zero in a FLI file.
  599.  
  600.   16      2     speed     Number of jiffies to delay
  601.                           between each frame during
  602.                           playback.  A jiffy is 1/70 of
  603.                           a second.
  604.  
  605.   18    110     reserved  Unused space, set to zeroes.
  606.  
  607.  
  608. The FLI frame chunks
  609.  
  610.  
  611. One or more frame chunks immediately follow the FLI
  612. file header.  The frame chunks in a FLI file are
  613. identical to those in a FLC file, except that postage
  614. stamp image (FLI_PSTAMP) and word-runlength-compression
  615. (FLI_SS2) data chunks never appear in FLI files.
  616.  
  617.  
  618. CEL - Animation Cel Files
  619.  
  620.  
  621. CEL files contain one or more frames of image data. 
  622. Both Animator Pro and the original Animator produce CEL
  623. files, but each uses a different file format.
  624.  
  625. To process a CEL file for input, read the first 2 bytes
  626. of the file.  If they are hex 9119, the file is an
  627. original Animator CEL file.  If the first two bytes are
  628. not 9119, it is an Animator Pro CEL file.
  629.  
  630.  
  631. Animator Pro CEL Files
  632.  
  633.  
  634. An Animator Pro CEL file is identical to a FLC file in
  635. all respects.  A CEL file should have a Celdata chunk
  636. in the file prefix chunk which describes the x,y
  637. placement of the CEL.  If the Celdata placement chunk
  638. is not present, assume a placement of 0,0.
  639.  
  640.  
  641. Original Animator CEL Files
  642.  
  643.  
  644. The original Animator also produced CEL files.  These
  645. were still-picture files, not the multi-frame files
  646. Animator Pro now uses.  A CEL file from the original
  647. Animator is identical to a PIC file from the original
  648. Animator in all respects.
  649.  
  650.  
  651. PIC - Picture Files
  652.  
  653.  
  654. PIC files contain still images in an uncompressed
  655. format.  Both the original Animator and Animator Pro
  656. produce PIC files.  The file formats are different;
  657. Animator Pro produces a hierarchial chunked file, while
  658. the original Animator file is a simpler fixed format. 
  659. These formats are detailed in the following sections.
  660.  
  661. To process a PIC file for input, read the first 2 bytes
  662. of the file.  If they are hex 9119, the file is an
  663. original Animator PIC format file.  If the first two
  664. bytes are not 9119, it is an Animator Pro PIC file.
  665.  
  666.  
  667. Animator Pro PIC Files
  668.  
  669.  
  670. Animator Pro uses this format to store a single-frame
  671. picture image or bitmap.  This format description
  672. applies to both PIC and MSK files.  The file begins
  673. with a 64-byte header defined as follows:
  674.  
  675. Offset  Length  Name      Description
  676.  
  677.    0       4    size      The size of the file,
  678.                           including this header.
  679.  
  680.    4       2    magic     File format identifier. 
  681.                           Always hex 9500.
  682.  
  683.    6       2    width     The width of the image, in
  684.                           pixels.
  685.  
  686.    8       2    height    The height of the image, in
  687.                           pixels.
  688.  
  689.   10       2    xcoord    The X coordinate; typically
  690.                           zero.  (See note below).
  691.  
  692.   12       2    ycoord    The Y coordinate; typically
  693.                           zero.  (See note below).
  694.  
  695.   14       4    userid    An arbitrary 4-byte value;
  696.                           generally zero.  Do not count
  697.                           on any particular value in
  698.                           this field.  Set this field
  699.                           to zero when creating a file.
  700.  
  701.   18       1    depth     The number of bits per pixel. 
  702.                           This is 8 for PIC files and
  703.                           1 for MSK files.
  704.  
  705.   19      45    reserved  Unused space; set to zeroes.
  706.  
  707.  
  708.                          Note
  709.  
  710.       The xcoord and ycoord values in a PIC file header
  711.       will typically be zero.  Non-zero values indicate
  712.       that the file contains a rectangle from within a
  713.       larger picture.  In this case, the xcoord and
  714.       ycoord values represent the relation of the saved
  715.       rectangle to the full image.  These values can be
  716.       safely ignored for most purposes.
  717.  
  718. Following the file header are the data chunks for the
  719. image.  Each data chunk within a PIC or MSK file is
  720. formatted as follows:
  721.  
  722. Offset  Length  Name      Description
  723.  
  724.    0       4    size      The size of the chunk,
  725.                           including this header.
  726.  
  727.    4       2    type      Data type identifier.
  728.  
  729.    6   (size-6) data      The color or pixel data.
  730.  
  731. The type values in the chunk headers indicate what type
  732. of graphics data the chunk contains.  The following
  733. values (and their associated mnemonic names) are
  734. currently found in PIC/MSK data chunks:
  735.  
  736. Value  Name             Description
  737.  
  738.   0    PIC_CMAP         Color palette info
  739.   1    PIC_BYTEPIXELS   Byte-per-pixel image data
  740.   2    PIC_BITPIXELS    Bit-per-pixel mask data
  741.  
  742. In a PIC_CMAP chunk, the first 2-byte word is a version
  743. code; currently this is set to zero.  Following the
  744. version word are all 256 palette entries in rgbrgb...
  745. order.  Each of the r, g, and b components is a single
  746. byte in the range of 0-255.  This type of chunk appears
  747. in PIC files; there will generally be no color map
  748. chunk in a MSK file.
  749.  
  750. In a PIC_BYTEPIXELS chunk, the image data appears
  751. immediately following the 6-byte chunk header.  The
  752. data is stored as one byte per pixel, in left-to-right,
  753. top-to-bottom sequence.  This type of chunk appears in
  754. PIC files.
  755.  
  756. In a PIC_BITPIXELS chunk, the bitmap data appears
  757. immediately following the 6-byte chunk header.  The
  758. data is stored as bits packed into bytes such that the
  759. leftmost bits appear in the high-order positions of
  760. each byte.  The bits are stored in left-to-right, top-
  761. to-bottom sequence.  When the width of the bitmap is
  762. not a multiple of 8, there will be unused bits in the
  763. low-order positions of the last byte on each line.  The
  764. number of bytes per line is ((width+7)/8).  This type
  765. of chunk appears in MSK files.
  766.  
  767. Original Animator PIC Files
  768.  
  769.  
  770. The original Animator uses this format to store a
  771. single-frame picture image.  This format description
  772. applies to both PIC and CEL files.  The file begins
  773. with a 32 byte header, as follows:
  774.  
  775. Offset  Length  Name      Description
  776.  
  777.    0       2    type      File type identifier.  Always
  778.                           hex 9119.
  779.  
  780.    2       2    width     Width of image.  Always 320
  781.                           in a PIC file; may be any
  782.                           value in a CEL file.
  783.  
  784.    4       2    height    Height of image.  Always 200
  785.                           in a PIC file; may be any
  786.                           value in a CEL file.
  787.  
  788.    6       2    xcoord    X coordinate for upper left
  789.                           corner of the image.  Always
  790.                           zero in a PIC file; may be
  791.                           non-zero in a CEL file.
  792.  
  793.    8       2    ycoord    Y coordinate for upper left
  794.                           corner of the image.  Always
  795.                           zero in a PIC file; may be
  796.                           non-zero in a CEL file.
  797.  
  798.   10       1    depth     Number of bits per pixel;
  799.                           always 8.
  800.  
  801.   11       1    compress  Compression flag; always
  802.                           zero.
  803.  
  804.   12       4    datasize  Size of the image data in
  805.                           bytes.
  806.  
  807.   16      16    reserved  Unused space; set to zeroes.
  808.  
  809. Immediately following the header is the color map.  It
  810. contains all 256 palette entries in rgbrgb... order. 
  811. Each of the r, g, and b components is a single byte in
  812. the range of 0-63.  Following the color palette is the
  813. image data, one byte per pixel.  The image data is
  814. stored in left-to-right, top-to-bottom sequence.
  815.  
  816.  
  817. MSK - Mask Data Files
  818.  
  819.  
  820. MSK files contain a bitmap image.  Both Animator Pro
  821. and the original Animator produce MSK files, but the
  822. formats are different.
  823.  
  824. To process a MSK file for input, check the file size. 
  825. If it is exactly 8000 bytes, the file is an original
  826. Animator MSK file.  If the file is any other size, it
  827. is an Animator Pro MSK file.
  828.  
  829.  
  830. Animator Pro MSK Files
  831.  
  832.  
  833. An Animator Pro MSK file is identical to an Animator
  834. Pro PIC file.  It will have a pixel depth of 1.
  835.  
  836.  
  837. Original Animator MSK Files
  838.  
  839.  
  840. A MSK file created by the original Animator is exactly
  841. 8000 bytes long.  There is no file header or other
  842. control information in the file.  It contains the image
  843. bit map, 1 bit per pixel, with the leftmost pixels
  844. packed into the high order bits of each byte.  The size
  845. of the image is fixed at 320x200.  The image is stored
  846. left-to-right, top-to-bottom.
  847.  
  848.  
  849. COL - Color Map Files
  850.  
  851.  
  852. A COL file stores the rgb values for entries in the
  853. color palette.  Both Animator Pro and the original
  854. Animator produce COL files, but the formats are
  855. different.
  856.  
  857. To process a COL file for input, check the file size. 
  858. If it is exactly 768 bytes, the file is an original
  859. Animator COL file.  If the file is any other size, it
  860. is an Animator Pro COL file.
  861.  
  862.  
  863. Animator Pro COL Files
  864.  
  865.  
  866. An Animator Pro COL file stores color palette
  867. information.  The file begins with an 8-byte header
  868. defined as follows:
  869.  
  870. Offset  Length  Name      Description
  871.  
  872.    0       4    size      The size of the file,
  873.                           including this header.
  874.  
  875.    4       2    magic     File format identifier. 
  876.                           Always hex B123.
  877.  
  878.    6       2    version   The version of color storage
  879.                           format.  Currently set to
  880.                           zero, indicating 256-level
  881.                           color data in each r,g,b
  882.                           component.
  883.  
  884. Following the file header are palette entries in
  885. rgbrgb... order.  Each of the r, g, and b components is
  886. a single byte in the range of 0-255.  Generally, there
  887. will be data for 256 palette entries, but this cannot
  888. be assumed.  The actual number of palette entries is
  889. ((size-8)/3); if this value is not an even multiple of
  890. three, the file is corrupted.
  891.  
  892.  
  893. Original Animator COL Files2
  894.  
  895.  
  896.  
  897. A COL file created by the original Animator is exactly
  898. 768 bytes long.  There is no file header or other
  899. control information in the file.  The rgb values for
  900. all 256 palette entries is stored in rgbrgb...
  901. sequence.  Each of the r, g, and b values is in the
  902. range of 0-63.
  903.  
  904.  
  905. PLY - Polygon Files
  906.  
  907.  
  908. A PLY file holds a set of points that describe a
  909. polygon.  Both Animator Pro and the original Animator
  910. create PLY files.  The file format is the same for
  911. both.
  912.  
  913. A PLY file starts with an 8-byte header, as follows:
  914.  
  915. Offset  Length  Name      Description
  916.  
  917.    0       2    points    Count of points in the file.
  918.  
  919.    2       4    reserved  Unused space; set to zero.
  920.  
  921.    6       1    closed    Closed-shape flag.  If 1,
  922.                           there is an implied
  923.                           connection between the last
  924.                           point and the first.  If
  925.                           zero, the shape is not
  926.                           closed.
  927.  
  928.    7       1    magic     File format identifier. 
  929.                           Always hex 99.
  930.  
  931. The points data follows the file header.  Each point is
  932. described with three 16-bit integers, representing the
  933. x, y, and z coordinates of each point.  The z
  934. coordinates are always zero.
  935.  
  936. TWE - Tween Data Files
  937.  
  938. A TWE file holds information about a tweening operation
  939. set up via the Tween menus.  The information includes
  940. the starting and ending shapes, and the optional user-
  941. specified links between the shapes.  Animator Pro
  942. creates tween files.
  943.  
  944. A TWE file begins with an 8-byte header defined as
  945. follows:
  946.  
  947. Offset  Length  Name        Description
  948.  
  949.    0       2    magic       File format identifier. 
  950.                             Always hex 1995.
  951.  
  952.    2       2    version     The file format version;
  953.                             always zero.
  954.  
  955.    4       4    tcount      The number of tween shapes
  956.                             in the file; always 2.
  957.  
  958.    8       8    reserved    Unused space; set to
  959.                             zeroes.
  960.  
  961.   16       4    linkcount   The number of link entries
  962.                             in the file.
  963.  
  964. Immediately following the file header are the link
  965. entries.  If the linkcount value is zero there are no
  966. links.  Each link entry is a pair of 32-bit integers. 
  967. The first value in each pair is the index of the point
  968. in the first shape, and the second value is the index
  969. of the point in the ending shape.  (IE, a link value of
  970. 2,7 says to link the second starting-shape point to the
  971. seventh ending-shape point.)
  972.  
  973. Following the link entries is the data block that
  974. describes the starting shape, then the data block that
  975. describes the ending shape.  The format of these blocks
  976. is identical to that of the polygon (PLY) file,
  977. including file header data.  In other words, they
  978. appear as if a pair of polygon files are embedded in
  979. the tween file at this point.
  980.  
  981.  
  982. OPT - Optics Menu Settings Files
  983.  
  984.  
  985. An OPT file holds information about an optics operation
  986. set up via the Optics menus.  Both Animator Pro and the
  987. original Animator create OPT files.  The file format is
  988. the same for both.
  989.  
  990. An OPT file starts with a 4-byte header, as follows:
  991.  
  992. Offset  Length  Name      Description
  993.  
  994.    0       2    magic     File type identifier.  Always
  995.                           hex 1A3F.
  996.  
  997.    2       2    count     Number of records in the
  998. file.
  999.  
  1000. Following the file header are optics records of 50
  1001. bytes each.  A record is generated for each click on
  1002. CONTINUE MOVE in the OPTICS menu.  The move records are
  1003. formatted as follows:
  1004.  
  1005. Offset  Length  Name          Description
  1006.  
  1007.    0       4    link          In the file, this field
  1008.                               is always zero.  In
  1009.                               memory, it's a pointer to
  1010.                               the next move record.
  1011.  
  1012.    4       6    spincenter    The x,y,z coordinates of
  1013.                               the spin center point;
  1014.                               three 16-bit values.
  1015.  
  1016.   10       6    spinaxis      The x,y,z coordinates of
  1017.                               the spin axis; three
  1018.                               16-bit values.
  1019.  
  1020.   16       6    spinturns     The x,y,z coordinates of
  1021.                               the spin turns; three 16-
  1022.                               bit values.
  1023.  
  1024.   22       4    spininter     Intermediate turns.  Two
  1025.                               16-bit values. These are
  1026.                               values for a conjugation
  1027.                               matrix that corresponds
  1028.                               to spin axis.
  1029.  
  1030.   26       6    sizecenter    The x,y,z coordinates of
  1031.                               the size center point;
  1032.                               three 16-bit values.
  1033.  
  1034.   32       2    xmultiplier   Determines (along with
  1035.                               xdivisor) how to scale
  1036.                               along x dimension.
  1037.  
  1038.   34       2    xdivisor      Determines (along with
  1039.                               xmultiplier) how to scale
  1040.                               along x dimension.
  1041.  
  1042.   36       2    ymultiplier   Determines (along with
  1043.                               ydivisor) how to scale
  1044.                               along y dimension.
  1045.  
  1046.   38       2    ydivisor      Determines (along with
  1047.                               ymultiplier) how to scale
  1048.                               along y dimension.
  1049.  
  1050.   40       2    bothmult      Like xmultiplier, but
  1051.                               applied to both
  1052.                               dimensions.
  1053.  
  1054.   42       2    bothdiv       Like xdivisor, but
  1055.                               applied to both
  1056.                               dimensions.
  1057.  
  1058.   44       6    linearmove    The x,y,z offset for a
  1059.                               linear move; three 16-bit
  1060.                               values.
  1061.  
  1062.  
  1063. Internal Usage Files (REC, SET, CFG, GLV, MU)
  1064.  
  1065.  
  1066. Each of these file types is created by Animator Pro to
  1067. store internal data between sessions.  These files must
  1068. not be touched by other applications.
  1069.  
  1070. REC files store macros.  Animator Pro REC files are not
  1071. the same as the REC files documented with the original
  1072. Animator.
  1073.  
  1074. SET files store internal settings information; they are
  1075. created by the Quit|Save menu, and by the Save Default
  1076. Settings menu.
  1077.  
  1078. CFG files store internal configuration information,
  1079. such as the video driver and mode.
  1080.  
  1081. GLV files store Poco Global Variables.  The data is
  1082. stored as a series of nullterminated strings, and must
  1083. not be modified using a normal text editor.
  1084.  
  1085. MU files store menu text, prompts, error messages, etc,
  1086. customized to the proper native language.  The data is
  1087. stored as normal ASCII text, and must not be modified
  1088. in any way.
  1089.